﻿using System;
using System.Collections.Generic;
using System.IO;

namespace ProjectPacker
{
    public class DataManager : ConfigClass
    {
        /// <summary>
        /// Save List of String
        /// </summary>
        /// <param name="_StringList">List of String to save</param>
        /// <param name="_FileName">File to save</param>
        public static void StringListSave(List<String> _StringList, String _FileName)
        {
            using (StreamWriter sw = new StreamWriter(_FileName))
            {
                foreach (String s in _StringList)
                {
                    sw.WriteLine(s);
                }
            }
        }
        /// <summary>
        /// Load List of String
        /// </summary>
        /// <param name="_FileName">File to load</param>
        /// <returns>List of String</returns>
        public static List<String> StringListLoad(String _FileName)
        {
            List<String> _StringList = new List<String>();
            using (StreamReader sr = new StreamReader(_FileName))
            {
                String s = "";
                do
                {
                    if (s != "")
                    {
                        _StringList.Add(s);
                    }
                    s = sr.ReadLine();
                } while (s != null);
            }
            return _StringList;
        }
    }
}
